#include <iostream>
#include "source\AWScript.hpp"
#include <ctime>
#include <fstream>

using namespace std;


int main(){
	ListIdentity a;
	a.push(new cIdentity(cRange(0,3),new cText("blank"),0));
	a.push(new cIdentity(cRange(9,9),new cText("gs"),0));
	cRegExp xreg(new cText("    hello "));
	xreg.init(new cText("@([^\\@$]|\\@|:gs:)*@")); //Bug:node can't repeat more than once.
	sRegExpReturn tmpR;
	tmpR=xreg.findNext(&a);
	
	ifstream fin("a.txt");
	cText ss="",temp;
	getline(fin,ss,'\n');
	while(!fin.eof()){
			getline(fin,temp,'\n');
			ss=ss+"\n"+temp;
	}

	cout<<ss;
	loadAWScript();
	//for(int i=0; i<100; ++i){
#define TESTRUN
#ifdef TESTRUN
	ptrParsedElement vx=Lining(ss);//"(v){var x=(e){System.MsgBox(e);}; static x.e=v; return x; }(\"hello world!\")(\"H\")");
	
	//ptrParsedElement vx=Lining("System.MsgBox(\"Hello world\")");

	ptrDough tmp=CreateDough();
	
	tmp->ParsedTree=vx;
	//for(int i=0; i<1000; ++i)
		eval(&GREAT,(tmp->ParsedTree),0);
	//};
#endif
	system("pause");
}